package com.fmy.springbootutils.tool;

import com.fmy.response.specs.IEnum;
import com.fmy.springbootutils.unusual.BusinessException;

/**
 * @author Mr.fmy
 * @version 1.0.0
 * @ClassName ExceptionTool.java
 * @Description TODO 异常高频方法
 * @createTime 2019年07月11日 10:13:00
 */
public class ExceptionTool {


    public static void throwBusiness(boolean is, String errMsg) {
        throwBusiness(is, new BusinessException(errMsg));
    }

    public static void throwBusiness(boolean is, IEnum iEnum, String errMsg) {
        throwBusiness(is, new BusinessException(iEnum, errMsg));
    }

    public static void throwBusiness(boolean is, BusinessException e) {
        if (is) throw e;
    }
}
